package io;

import org.junit.Test;

import java.io.*;
import java.nio.charset.Charset;

/**
 * FileReader测试类，
 *
 * @Author: zhenzhong.wang@honeywell.com
 * @Date: 2019/4/13 9:51 AM
 */
public class FileReaderDemo {

  @Test
  public void test() throws IOException {
    // 注意：BufferedReader并不是filterReader的子类, 这点和BufferedInputStream不同，它是FilterInputStream的子类
    BufferedReader bufferedReader = new BufferedReader(
        new InputStreamReader(
            new FileInputStream("/Users/zhenzhong/WorkspaceCore/java-test/src/main/java/io/CompletableFutureDemo.java"), "utf-8"));
    String s;
    while ((s = bufferedReader.readLine()) != null) {
      System.out.println(s);
    }
  }
}
